interface DateDifference {
    days: number;
}

function getDaysBetweenDates(date1: string, date2: string): DateDifference {
    const startDate: Date = new Date(date1);
    const endDate: Date = new Date(date2);
    const timeDifference: number = endDate.getTime() - startDate.getTime();
    const daysDifference: number = timeDifference / (1000 * 3600 * 24);

    return {
        days: Math.abs(Math.ceil(daysDifference))
    };
}

// 示例用法
const result: DateDifference = getDaysBetweenDates('2024-08-01', '2024-08-14');
console.log(`两个日期之间的天数差为: ${result.days} 天`); // 输出: 两个日期之间的天数差为: 13 天
